// dom事件兼容处理
var EventUtil = {
            addHander: function(element, type, hanlder) {
                if(element.addEventListener) {
                    element.addEventListener(type, hanlder, false);
                }else if(element.attachEvent) {
                    element.attachEvent("on" + type, hanlder);
                }else {
                    element["on" + type] = hanlder;
                }
            },
            removeHander: function(element, type, hanlder) {
                if(element.removeEventListener) {
                    element.removeEventListener(type, hanlder, false);
                }else if(element.detachEvent) {
                    element.detachEvent("on" + type, hanlder);
                }else {
                    element["on" + type] = null;
                }
            }            
    };
//调用
EventUtil.addHander(btn, 'click', fn);